<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>修改会员信息</title>
    <link rel="stylesheet" href="__STATIC_URL__/static/mobile/css/weui.css" />
    <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js"></script>
    <script src="__STATIC_URL__/static/mobile/js/weui.min.js"></script>
    <script src="__STATIC_URL__/static/mobile/js/picker.js"></script>
</head>
<style type="text/css">
    body{
        background: #F8F8F8;
    }
    .titinfo{
        font-size:14px;
        padding: 10px 15px 0 15px;
    }
    .weui-cells{
        font-size: 14px;
    }
    .sex{ overflow: hidden; }
    .sex span{ display: inline-block; }
    .sex i {
        display: block;
        float: left;
        width: 14px;
        height: 14px;
        border: 2px solid #9b6820;
        background-color: #fff;
        border-radius: 50%;
        -o-border-radius: 50%;
        -ms-border-radius: 50%;
        -moz-border-radius: 50%;
        -webkit-border-radius: 50%;
    }
    .sex span.cur i {background: #9b6820 }
</style>
<body>
<div class="container" id="container">
    <div class="titinfo">
        请完善以下信息，带*为必填项，置灰表示不可修改
    </div>
    <form method="post" action="{:url('carduser/editinfohand')}" >
    <div class="weui-cells weui-cells_form">

          <input type="hidden" name="id" value="{$info.id}">
          <input type="hidden" name="card_id" value="{$info.card_id}">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" name="name" value="{$info.name}" placeholder="请输入姓名">
            </div>
        </div>
        <div class="weui-cell sex J_sex">
            <div class="weui-cell__hd"><label class="weui-label">性别</label></div>
            <div class="weui-cell__bd">
                <span {eq name="info.sex" value="1"}class="cur"{/eq} data-value="1"><i></i><font>男</font></span>
                <span {eq name="info.sex" value="0"}class="cur"{/eq} data-value="0"><i></i><font>女</font></span>
                <input type="hidden" name="sex" value="{$info.sex}" />
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">生日</label></div>
            <div class="weui-cell__bd">
                <input type="hidden" id="birth" name="birth" value="{$info.birth}">
                <input class="weui-input" type="text" name="birthday" id="birthday" value="{$info.birthday}" >
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">所属地区</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" name="address" value="{$info.address}">
            </div>
        </div>
          <div class="weui-cell">
              <div class="weui-cell__hd"><label class="weui-label">手机号</label></div>
              <div class="weui-cell__bd">
                  <input class="weui-input" type="text" name="phone" value="{$info.phone}" placeholder="请输入您的常用手机号">
              </div>
          </div>

        <!--    <a href="javascript:;" class="weui-btn weui-btn_primary" >确认修改</a> -->

    </div>
        <button class="weui-btn weui-btn_primary" type="submit" style="margin-top: 15px;width: 85%;">确认修改</button>
    </form>


</div>
</body>
<script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">
//    wx.config({$share.wxjssdk});
//    wx.ready(function(){
//        wx.hideAllNonBaseMenuItem();
//
//        // config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，config是一个客户端的异步操作，所以如果需要在页面加载时就调用相关接口，则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口，则可以直接调用，不需要放在ready函数中。
//    });
</script>
<script type="text/javascript">
    $(function(){
        $('#birthday').on('click', function () {
            var val = $("#birth").val().split(',');
            weui.datePicker({
                start: 1899,
                end: new Date().getFullYear(),
                defaultValue: val,
                onChange: function (result) {
                    $("#birth").val(result);
                    $("#birthday").val(result[0]+'-'+result[1]+'-'+result[2])
                },
                onConfirm: function (result) {
                    $("#birth").val(result);
                    $("#birthday").val(result[0]+'-'+result[1]+'-'+result[2])
                }
            });
        });
        $('.sex span').on('click', function () {
            $(this).addClass('cur');
            $(this).siblings('span').removeClass('cur');
            var value = $(this).data('value');
            $(this).parent().find('input').val(value);
        });
    })

</script>
</html>
